Mammals and Water Availability: Plots Study Results

The aim of this study is to assess the effect of water scarcity on the distribution of an African herbivore guild along the Ruaha River, TZ

Stephanie Kramer-Schadt https://ecodynizw.github.io (Leibniz Institute for Zoo and Wildlife Research)https://izw-berlin.de/en/ , Cédric Scherer https://cedricscherer.com (Leibniz Institute for Zoo and Wildlife Research)https://izw-berlin.de/en/
November 13, 2023

Setup

Libraries

Theme

# ggplot theme
theme_set(theme_d6())

Data

df_transects <- readRDS(here::here("output", "stommel_mastertable_20230127_cleaned.rds"))

head(df_transects)
# A tibble: 6 × 35
  survey_id water_id water_id_num   lon   lat  utm_x   utm_y
      <int> <fct>           <int> <dbl> <dbl>  <int>   <int>
1         7 762               762  35.0 -7.64 719453 9155220
2        37 945               945  35.1 -7.53 729665 9166933
3        38 946               946  35.1 -7.53 729815 9166929
4        49 1028             1028  35.1 -7.49 735366 9171145
5        78 671               671  34.9 -7.68 712918 9151021
6        80 684               684  34.9 -7.67 712941 9151284
# ℹ 28 more variables: transect_location <int>, transect_GRR <fct>,
#   transect_id <int>, river_class <fct>, year <int>, week <int>,
#   weeks_all <int>, juldate <int>, dry_season <fct>,
#   distance_to_water <dbl>, distance_to_water_rounded <int>,
#   species <fct>, species_id <int>, FEEDTYPE_A <int>,
#   feed_type_A_char <fct>, FEEDTYPE_B <int>, species_count <int>,
#   all_in_one <fct>, FEEDTYPE_C <fct>, FEEDTYPE_custom <int>, …
names(df_transects)
 [1] "survey_id"                 "water_id"                 
 [3] "water_id_num"              "lon"                      
 [5] "lat"                       "utm_x"                    
 [7] "utm_y"                     "transect_location"        
 [9] "transect_GRR"              "transect_id"              
[11] "river_class"               "year"                     
[13] "week"                      "weeks_all"                
[15] "juldate"                   "dry_season"               
[17] "distance_to_water"         "distance_to_water_rounded"
[19] "species"                   "species_id"               
[21] "FEEDTYPE_A"                "feed_type_A_char"         
[23] "FEEDTYPE_B"                "species_count"            
[25] "all_in_one"                "FEEDTYPE_C"               
[27] "FEEDTYPE_custom"           "feedtype"                 
[29] "fyear"                     "ftransect_id"             
[31] "fweeks_all"                "fweek"                    
[33] "river_comp"                "friver_comp"              
[35] "dist_class"               
#summary(df_transects)

Define Labels

# species sorting alphabetically according to their feeding type
# B        CD       E           G       I      K        Wb      Wh    Z
# grazer   omni     mixed       browser mixed  browser  grazer  omni  grazer

# Grazer:  B, Wb, Z
# mixed:   E, I,
# browser: G, K
# omni:    CD, Wh

species_labels <- as_labeller(
  c(`B`  = "Buffalo",
    `Wb` = "Waterbuck",
    `Z`  = "Zebra",
    `E`  = "Elephant",
    `I`  = "Impala",
    `G`  = "Giraffe",
    `K`  = "Kudu",
    `Wh` = "Warthog",
    `CD` = "Common duiker")
)

river_comp_labels <- as_labeller(
  c(`0`  = "upper",
    `1`  = "along",
    `2`  = "perpend")
)

Define Color Codes

## create table matching colors to species, grouped by feeding type
df_spec_colours <- data.frame(
  species = levels(df_transects$species), ## is orderd by feedtype (see above)
  color = c(
    brewer.pal(name = "YlGn", n = 9)[c(5,7,9)], ## grazer (3)
    carto_pal(name = "Burg", n = 7)[c(4,6)],    ## mixed (2)
    brewer.pal(name = "Blues", n = 7)[c(4,6)],  ## browser (2)
    carto_pal(name = "Purp", n = 7)[c(4,6)]     ## omni (2)
  )
)

my_spec_colours <- df_spec_colours$color
names(my_spec_colours) <- df_spec_colours$species


## create feeding type colors, as middle color of species colors above
my_feedtype_colours <- c(
  brewer.pal(name = "YlGn", n = 9)[7],  ## grazer
  brewer.pal(name = "Blues", n = 7)[5], ## browser
  carto_pal(name = "Burg", n = 7)[5],   ## mixed
  carto_pal(name = "Purp", n = 7)[5]    ## omni
)

## create color code for the 3 river classes (downstream/midstream/upstream)
my_river_class_cols <- c( "cadetblue1", "navyblue","lightblue") 
my_alongside_cols   <- c( "navyblue","cadetblue1") 

## create color code for seasons
my_season_cols      <- c("#637D37", "#E8CF55")

## create color code for distances
my_dist_class_cols  <- c("cadetblue1", "peachpuff4") 

## 
colors <- c("#FF0000", "#0000FF")
color_ramp <- colorRampPalette(colors)(6)
my_all_in_one_cols <- color_ramp
my_transect_cols <- viridis::turbo(n = 10)

Main Tables

Table 1

Summarize the total counts per river section (perpendicular/ alongside). This might be misleading, as the same species were counted at every sampling event (33 weeks across the 3 years).

data_table_1 <- 
  df_transects |> 
  group_by(transect_GRR, year, species, feed_type_A_char, dry_season) |> 
  summarize(
    sum_species_count = sum(species_count),
    mean_group_size   = round(mean(species_count), digits = 2),
    sd_group_size     = round(sd(species_count), digits = 2),
    mean_species_distance = round(mean(distance_to_water), digits = 2),
    sd_species_distance   = round(sd(distance_to_water), digits = 2)
  )

data_table_1
# A tibble: 96 × 10
# Groups:   transect_GRR, year, species, feed_type_A_char [51]
   transect_GRR  year species feed_type_A_char dry_season
   <fct>        <int> <fct>   <fct>            <fct>     
 1 alongside     2011 Z       grazer           early     
 2 alongside     2011 Z       grazer           late      
 3 alongside     2011 Wb      grazer           early     
 4 alongside     2011 Wb      grazer           late      
 5 alongside     2011 B       grazer           early     
 6 alongside     2011 B       grazer           late      
 7 alongside     2011 I       mixed            early     
 8 alongside     2011 I       mixed            late      
 9 alongside     2011 E       mixed            early     
10 alongside     2011 E       mixed            late      
# ℹ 86 more rows
# ℹ 5 more variables: sum_species_count <int>, mean_group_size <dbl>,
#   sd_group_size <dbl>, mean_species_distance <dbl>,
#   sd_species_distance <dbl>
table_1 <- 
  data_table_1 |>
  select(
    transect_GRR ,year,species,feed_type_A_char, dry_season,
    sum_species_count, mean_group_size, mean_species_distance
  ) |>
  pivot_wider(
    names_from = c(year,dry_season),
    values_from = c(sum_species_count, mean_group_size, mean_species_distance)
  )

write.table(
  x = table_1,
  file = here("output", "stommel_transects_table_1.txt"),
  sep = '\t', col.names = TRUE, row.names = FALSE
)

Main Figures

Figure 1: Map Study Area

Separate .rmd file: ./R/01_map_fig1.rmd

Figure 2: Herd Sizes

data_table_2 <- 
  df_transects |> 
  group_by(year, week, transect_GRR, dry_season, feed_type_A_char, species) |> 
  summarize(
    sum_species_count     = sum(species_count),
    mean_group_size       = round(mean(species_count), digits = 2),
    sd_group_size         = round(sd(species_count), digits = 2),
    mean_species_distance = round(mean(distance_to_water), digits = 2),
    sd_species_distance   = round(sd(distance_to_water), digits = 2)
  )

#summary(data_table_2)

ggplot(data_table_2, aes(x = transect_GRR, y = sum_species_count, fill = dry_season)) + 
  geom_boxplot(width = .7, color = "black", linewidth = .2, outlier.size = .3,
               position = position_dodge(preserve = "single")) + 
  facet_wrap(~ species, scale = "free_y", ncol = 3, 
             labeller = labeller(species = species_labels)) +
  scale_y_continuous(expand = expansion(mult = c(.005, .1)), limits = c(0, NA)) +
  scale_fill_manual(values = my_season_cols, name = "Dry season:") + 
  labs(x = "Transect section", 
       y = "Total count of individuals per sighting") +
  scale_x_discrete(labels = c("alongs.", "perpend.")) +
  theme_d6(grid = "y") +
  theme(#axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1),
        axis.text.x = element_text(angle = 35, vjust = 1, hjust = 1), 
        panel.spacing.x = unit(1, "lines"))
ggsave(here("plots", "Fig2_herd_sizes_transect_GRR.png"), 
       width = 20, height = 15, units = "cm", dpi = 600, bg = "white")

Figure 3: Median Distances per Species and Transect GRR

ggplot(df_transects, aes(x = dry_season, y = distance_to_water, fill = species)) + 
  geom_boxplot(
    aes(fill = species),
    width = 1, color = "grey90", outlier.shape = 21
  ) + 
  facet_wrap(~ transect_GRR, scale = "free_y", labeller = labeller(species = species_labels)) +
  scale_y_continuous(
    labels = scales::label_comma(), limits = c(0, NA),
    expand = expansion(mult = c(.001, .05))
  ) +  
  scale_fill_manual(
    values = clr_darken(my_spec_colours, .3), name = "Species:",
    guide = guide_legend(byrow = TRUE, nrow = 1, label.position = "bottom")
  ) +
  labs(x = "Dry season", y = "Distance to water [m]") +
  theme_d6(grid = "y") +
  theme(legend.key.width = unit(2, "lines"),
        legend.justification = "left")
ggsave(here("plots", "Fig3_distance_to_water_class.png"), 
       width = 15, height = 12, units = "cm", dpi = 600, bg = "white")

Supplement Materials

Table S2: Sightings per Species

Summarise number of sightings (not counts) per species per season for reviewer

sight <- table(df_transects$dry_season, df_transects$species)
sight <- table(df_transects$dry_season, df_transects$species, df_transects$transect_GRR)
sight
, ,  = alongside

       
          Z  Wb   B   I   E   G   K  Wh  CD
  early  31  26  27 927  70 100  35  19   0
  late   59  21  13 794  95 126  73  39   1

, ,  = perpendicular

       
          Z  Wb   B   I   E   G   K  Wh  CD
  early  42   2   2 321  39 112  53  40  26
  late   37   4   1 300  43  91  59  29  29

Figure S1: GAM

gam_mod <- gam(
  distance_to_water_rounded ~  species +  s(juldate, by = species, k = 3),
  family = nb(),
  data = df_transects
)

#summary(gam_mod)

#R-sq.(adj) =  0.113   Deviance explained = 10.4%
#-REML =  30895  Scale est. = 1         n = 3686

model_p <- predict_gam(gam_mod)

model_p |>
  ggplot(aes(juldate, fit, fill = species)) +
  geom_smooth_ci(species, linewidth = 1.2) +
  geom_line(aes(group = species), lwd = 2.5, color = "white") + 
  geom_smooth_ci(species, linewidth = 1.2) +
  labs(title = NULL, x = "Day since June 1st", y = "Smoothing function") +
  scale_color_manual(values = my_spec_colours, name = "Species:") +
  scale_fill_manual(values = my_spec_colours, name = "Species:") +
  scale_linetype_discrete(name = "Species:") +
  guides(color = guide_legend(nrow = 1))
ggsave(here("plots", "FigS1_model_fits_gam.png"), 
       width = 21, height = 15, units = "cm", dpi = 600, bg = "white") 

Figure S2: Seasonal Densitiy Distributions

## to calculate densities we need individual sighting data
df_transects_uncount <- tidyr::uncount(df_transects, species_count)

## function to create density plot as grid for all or selected species 
plot_densities <- function(spec = "all") {
  if (any(spec == "all")) { 
    dat <- df_transects_uncount
  } else {
    dat <- filter(df_transects_uncount, species %in% spec)
  }
  
  ggplot(dat, aes(lon, lat , fill = dry_season)) +
    geom_hdr() +
    geom_hdr_lines(aes(color = dry_season), lwd = .5) + 
    geom_point(shape = 21, size = .1) +
    geom_hdr_rug() +
    facet_wrap(~ species, labeller = labeller(species = species_labels)) +
    scale_color_manual(values = clr_darken(my_season_cols, .2), name = NULL) +
    scale_fill_manual(values = my_season_cols, name = NULL) +
    labs(x = "Longitude", y = "Latitude") +
    theme_d6(grid = "none")
}

All species for supplement figure

plot_densities(spec = "all")
ggsave(here("plots", "FigS2_density_plots_all.png"), 
       width = 20, height = 20, units = "cm", dpi = 600, bg = "white")

Selected species for main figure: Zebra, Wb and B

plot_densities(spec = c("Z", "Wb", "B"))
# ggsave(here("plots", "FigS2_density_plots_selected.png"), 
#        width = 20, height = 9, units = "cm", dpi = 600, bg = "white")

Figure S3: Mean Group Sizes

data_table_3 <- 
  df_transects |> 
  group_by(fyear, week, dry_season,species) |> 
  summarize(
    sum_species_count     = sum(species_count),
    mean_group_size       = round(mean(species_count), digits = 2),
    sd_group_size         = round(sd(species_count), digits = 2),
    mean_species_distance = round(mean(distance_to_water), digits = 2),
    sd_species_distance   = round(sd(distance_to_water), digits = 2)
  )

#summary(data_table_3)

ggplot(data_table_3, aes(x = dry_season, y = mean_group_size, fill = species)) + 
  geom_boxplot(width = .5, color = "black", position = position_dodge(width = 1)) +   
  facet_wrap(~ species, scale = "free_y", ncol = 3, 
             labeller = labeller(species = species_labels)) +
  scale_y_continuous(expand = expansion(mult = c(.005, .1)), limits = c(0, NA)) +
  scale_fill_manual(values = my_spec_colours, guide = "none") +
  labs(x = "Dry season", y = "Average group size per sampling week") +
  theme_d6(grid = "y")
ggsave(here("plots", "FigS3_mean_group_sizes.png"), 
       width = 20, height = 20, units = "cm", dpi = 600, bg = "white")

Figure S4 + S5: Model Results

GLMM model fit

-> models were run on outsourced file 5_b_DataAnalysis_sourcedModels_20230619.rmd

## not run
# source(here("R", "5_b_DataAnalysis_sourcedModels_20230619.rmd"))

Load best model:

rds <- here("output", "mod444_20230619.rds")

## for now always run model due to version issues across computers
if (!file.exists(rds)) {
  mvvss <- glmmTMB(
    distance_to_water_rounded ~ species * (juldate + transect_GRR) + (1 | ftransect_id) ,
    data = df_transects, family = nbinom2, na.action = na.fail)
  
  write_rds(mvvss, file = rds)
} else {
  mvvss <- read_rds(rds) 
}
mod_summary <- summary(mvvss)
#mod_summary

mod_res   <- as.data.frame(round(mod_summary$coefficients$cond, digits = 7))
mod_names <- dimnames(mod_summary$coefficients$cond)[[1]]

res_table <- cbind(mod_names,mod_res)
#res_table

write.table(
  x = res_table,
  file = here("output", "model_feed_results_20230716.txt"),
  sep = '\t', col.names = TRUE, row.names = FALSE
)

Figure S4: Model Diagnostics with DHARMa


    DHARMa nonparametric dispersion test via sd of residuals
    fitted vs. simulated

data:  simulationOutput
dispersion = 0.67579, p-value = 0.328
alternative hypothesis: two.sided
simulationOutput <- simulateResiduals(fittedModel = mvvss, plot = FALSE)

png(here("plots", "FigS4b_dharma_residuals.png"), width = 700, height = 500)
plot(simulationOutput)
dev.off()
agg_png 
      2 
# 
# testOutliers(simulationOutput, type = "bootstrap")
# 
# png(here("plots", "FigS4a_dharma_prediction_cat.png"), width = 700, height = 400)
# testCategorical(simulationOutput, catPred = df_transects$species) 
# dev.off()
# 
# testCategorical(simulationOutput, catPred = df_transects$transect_GRR)
# 
# testZeroInflation(simulationOutput)

Figure S5: Regression Coefficient Plots

jtools::plot_summs(mvvss, inner_ci_level = .75) +
  labs(y = NULL) +
  theme_d6(grid = "x", mono = "x") +
  theme(axis.text.y = element_text(hjust = 0),
        panel.border = element_blank(),
        axis.ticks = element_blank())
ggsave(here("plots", "FigS5_model_effects.png"), width = 20, height = 23, unit = "cm", bg = "white")

MuMIn::r.squaredGLMM(mvvss)
                R2m       R2c
delta     0.7114393 0.7672517
lognormal 0.7384561 0.7963880
trigamma  0.6763821 0.7294442

Figure S6: GLMM Random Effects

re <- ranef(mvvss)

dd <- as.data.frame(re)

ggplot(dd, aes(y = grp, x = condval)) +
  geom_point() + 
  geom_errorbarh(aes(xmin = condval - 2 * condsd, xmax = condval + 2 * condsd), height = 0) +
  geom_vline(xintercept = 0, color = 'black', lty = 2) +
  scale_y_discrete(expand = c(0.05, 0)) +
  labs(x = "conditional effect", y = "transect ID",
       title = "Intercept") 
## alternative version
dd |> 
  mutate(
    lwr = condval - 2 * condsd,
    upr = condval + 2 * condsd,
    ci = if_else(lwr < 0 & upr > 0, TRUE, FALSE)
  ) |> 
  ggplot(aes(y = grp, x = condval)) +
  geom_point(aes(color = ci), size = 2) + 
  geom_errorbarh(aes(xmin = lwr, xmax = upr, color = ci), height = 0) +
  geom_vline(xintercept = 0, lty = 2) +
  scale_y_discrete(expand = c(0.05, 0)) +
  scale_color_manual(values = c("firebrick", "dodgerblue"), guide = "none") +
  labs(x = "conditional effect", y = "transect ID",
       title = "Intercept") 
ggsave(here("plots", "FigS6_random_effects_transID.png"), 
       width = 15, height = 12, units = "cm", dpi = 600, bg = "white")

Figures for Reviewers

Heatmap Sampling Transects

Summarise the time intervals at which each transect was sampled for reviewer.

table(df_transects$weeks_all[df_transects$year == 2011], df_transects$ftransect_id[df_transects$year == 2011])
    
      1  2  3  4  5  6  7  8  9 10
  1   2  5  5 10  0  5 12  8 16 13
  2   4  6  6 15  2  1  4 18 19 14
  3   9  4  2 13  3 11  5 16 16 13
  4   3 10  4  3  3  9  8  8 22 11
  5   6  7  5 11  1 12 15 20 16 16
  6  12 11  6  9  4  9  8 28 22 21
  7   8  5  3 19  3  6  6 27 25 23
  8   7  3  4 10  5 10 15 28 21 28
  9   5  6  6 10  7  9  8 14 25 16
  10  5  9  6  8  6  6 10  6 24 19
  11  3  8  2 14  5  6 11 12 15 17
sy <- 2011 ## transect drive year
td <- table(df_transects$juldate[df_transects$year == sy], df_transects$ftransect_id[df_transects$year == sy])
m_td <- as.matrix(td)
colMain <- colorRampPalette(brewer.pal(8, "Blues"))(25)
heatmap(m_td, Colv = NA, Rowv = NA, scale = "column",col = colMain,
        xlab = "transect", ylab = "day since onset of dry season")

Old Figures

Silhoutte Plot Study Species

## paths to images
zebra <- image_read("https://images.phylopic.org/images/81caf94e-5cbe-4e5e-8101-545abea2bfc0/raster/512x358.png")
kudu <- image_read("https://images.phylopic.org/images/e590147d-93c5-4d81-bbbf-bd1410cf8135/raster/1536x1055.png?build=159")
elephant <- image_read("https://images.phylopic.org/images/80db1004-bc9f-4318-84e7-cdd9639a1f3e/raster/1536x952.png?build=159")
giraffe <- image_read("https://images.phylopic.org/images/bbce74cf-4df3-4b7d-8b1d-f5b24dd3264a/raster/144x190.png")
duiker <- image_read(here("plots", "commonduiker_pathed_rohering.png"))
warthog <- image_read("https://images.phylopic.org/images/b1a641cd-25df-4dd0-865f-1a2728bd267e/raster/1536x916.png?build=159")
buffalo <- image_read("https://images.phylopic.org/images/65c4a9b3-dcde-4f0f-9a1f-8d71e74be9ec/raster/174x127.png?build=159")
impala <- image_read("https://images.phylopic.org/images/e07d1491-1d85-4c47-9f7d-075ea57bf0c5/raster/1536x1079.png?build=159")
waterbuck <- image_read("https://images.phylopic.org/images/f93103f1-e2a0-4c73-b274-c7b51afe4db0/raster/829x1024.png?build=159")

## import images
img <- function(png) { grid::rasterGrob(png, interpolate = FALSE) }

## create graphic
animals <- wrap_plots(
  img(zebra), img(waterbuck),img(buffalo),
  img(impala),img(elephant),
  img(giraffe),img(kudu),   
  img(warthog),img(duiker),   
  nrow = 1
)

animals + plot_layout(widths = c(0.8, 1, 1.4, 1.2, 1.4, 0.8, 1.3, 0.8, 0.8))
# ggsave(here("plots", "animals.png"), 
#        width = 15, height = 2, units = "cm", dpi = 600, bg = "white")

Model Fits per Species

mydfss1 <- ggpredict(mvvss, terms = c("juldate", "species",  "transect_GRR [alongside]")) 
mydfss2 <- ggpredict(mvvss, terms = c("juldate", "species", "transect_GRR [perpendicular]"))

plot_predict <- function(data, upper_y, title) {
  ggplot(data = data, aes(x = x, y = predicted)) + 
    geom_ribbon(
      aes(ymin = conf.low, ymax = conf.high, group = group), 
      fill = "white"
    ) + 
    geom_ribbon(
      aes(ymin = conf.low, ymax = conf.high, fill = group, 
          fill = after_scale(clr_desaturate(clr_lighten(fill, .2), .3)),
          color = after_scale(clr_lighten(fill, .6))), 
      alpha = .15, lwd = .2
    ) + 
    geom_line(aes(group = group), lwd = 2, color = "white") + 
    geom_line(aes(color = group), lwd = 1.2) + 
    coord_cartesian(expand = FALSE, ylim = c(0, upper_y)) +
    scale_y_continuous(labels = scales::label_comma(suffix = " km", scale = 1 / 1000)) +
    scale_color_manual(values = my_spec_colours, name = "Species:") +
    scale_fill_manual(values = my_spec_colours, name = "Species:") +
    guides(color = guide_legend(nrow = 1), fill = guide_legend(nrow = 1)) +
    labs(x = "Days since June 1st", y = "Distance to water", title = title) +
    theme(legend.key.width = unit(2, "lines"))
}

p1 <- plot_predict(mydfss1, upper_y =  3000, title = "Alongside transects")
p2 <- plot_predict(mydfss2, upper_y = 13000, title = "Perpendicular transects") +
        scale_y_continuous(labels = scales::label_comma(suffix = " km", scale = 1 / 1000), 
                           breaks = 0:4*3000) + 
        labs(y = NULL)

(p1 + p2) * theme(plot.title.position = "panel") + 
  plot_layout(guides = "collect")
# ggsave(here("plots", "Fig4_negbin_prediction_mod444_both.png"), 
#        width = 30, height = 15, units = "cm", dpi = 600, bg = "white")

References

citation("ggplot2")
To cite ggplot2 in publications, please use

  H. Wickham. ggplot2: Elegant Graphics for Data Analysis.
  Springer-Verlag New York, 2016.

A BibTeX entry for LaTeX users is

  @Book{,
    author = {Hadley Wickham},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2016},
    isbn = {978-3-319-24277-4},
    url = {https://ggplot2.tidyverse.org},
  }
citation("glmmTMB")
To cite glmmTMB in publications use:

  Mollie E. Brooks, Kasper Kristensen, Koen J. van Benthem,
  Arni Magnusson, Casper W. Berg, Anders Nielsen, Hans J.
  Skaug, Martin Maechler and Benjamin M. Bolker (2017).
  glmmTMB Balances Speed and Flexibility Among Packages for
  Zero-inflated Generalized Linear Mixed Modeling. The R
  Journal, 9(2), 378-400. doi: 10.32614/RJ-2017-066.

A BibTeX entry for LaTeX users is

  @Article{,
    author = {Mollie E. Brooks and Kasper Kristensen and Koen J. {van Benthem} and Arni Magnusson and Casper W. Berg and Anders Nielsen and Hans J. Skaug and Martin Maechler and Benjamin M. Bolker},
    title = {{glmmTMB} Balances Speed and Flexibility Among Packages for Zero-inflated Generalized Linear Mixed Modeling},
    year = {2017},
    journal = {The R Journal},
    doi = {10.32614/RJ-2017-066},
    pages = {378--400},
    volume = {9},
    number = {2},
  }
citation("DHARMa")
To cite package 'DHARMa' in publications use:

  Hartig F (2022). _DHARMa: Residual Diagnostics for
  Hierarchical (Multi-Level / Mixed) Regression Models_. R
  package version 0.4.6,
  <https://CRAN.R-project.org/package=DHARMa>.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {DHARMa: Residual Diagnostics for Hierarchical (Multi-Level / Mixed)
Regression Models},
    author = {Florian Hartig},
    year = {2022},
    note = {R package version 0.4.6},
    url = {https://CRAN.R-project.org/package=DHARMa},
  }

Session Info
[1] "2023-11-13 15:28:04 CET"
git2r::repository()
Local:    master C:/Users/scherer/PopDynCloud/Projects/mammals_africa_transects_schmied_c
Remote:   master @ origin (https://github.com/EcoDynIZW/mammals_africa_transects_schmied_c.git)
Head:     [5a24614] 2023-10-23: clean script 1
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=C                             

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
 [1] magick_2.7.4        patchwork_1.1.2     prismatic_1.1.1    
 [4] ggdensity_1.0.0     rcartocolor_2.1.1   RColorBrewer_1.1-3 
 [7] ggplot2_3.4.2       d6_0.1.0.4          tidymv_3.4.2       
[10] readr_2.1.4         tidyr_1.3.0         dplyr_1.1.2        
[13] here_1.0.1          broom.mixed_0.2.9.4 mgcv_1.8-42        
[16] nlme_3.1-162        glmmTMB_1.1.7       DHARMa_0.4.6       
[19] jtools_2.2.2        ggeffects_1.3.2     MuMIn_1.47.5       

loaded via a namespace (and not attached):
  [1] rstudioapi_0.14     jsonlite_1.8.5      magrittr_2.0.3     
  [4] farver_2.1.1        nloptr_2.0.3        rmarkdown_2.22     
  [7] fs_1.6.2            ragg_1.2.5          vctrs_0.6.2        
 [10] memoise_2.0.1       minqa_1.2.5         htmltools_0.5.5    
 [13] forcats_1.0.0       usethis_2.2.0       haven_2.5.2        
 [16] curl_5.0.1          broom_1.0.5         sass_0.4.6         
 [19] parallelly_1.36.0   bslib_0.5.0         htmlwidgets_1.6.2  
 [22] desc_1.4.2          cachem_1.0.8        TMB_1.9.6          
 [25] mime_0.12           lifecycle_1.0.3     pkgconfig_2.0.3    
 [28] gap_1.5-3           Matrix_1.5-4        R6_2.5.1           
 [31] fastmap_1.1.1       rbibutils_2.2.13    future_1.32.0      
 [34] shiny_1.7.4         digest_0.6.31       numDeriv_2016.8-1.1
 [37] colorspace_2.1-0    furrr_0.3.1         ps_1.7.5           
 [40] rprojroot_2.0.3     pkgload_1.3.2       textshaping_0.3.6  
 [43] labeling_0.4.2      fansi_1.0.4         compiler_4.3.0     
 [46] remotes_2.4.2       withr_2.5.0         pander_0.6.5       
 [49] backports_1.4.1     viridis_0.6.3       pkgbuild_1.4.1     
 [52] highr_0.10          MASS_7.3-58.4       sessioninfo_1.2.2  
 [55] tools_4.3.0         httpuv_1.6.11       glue_1.6.2         
 [58] callr_3.7.3         promises_1.2.0.1    grid_4.3.0         
 [61] generics_0.1.3      isoband_0.2.7       gtable_0.3.3       
 [64] tzdb_0.4.0          hms_1.1.3           utf8_1.2.3         
 [67] pillar_1.9.0        stringr_1.5.0       later_1.3.1        
 [70] splines_4.3.0       lattice_0.21-8      tidyselect_1.2.0   
 [73] miniUI_0.1.1.1      git2r_0.32.0        downlit_0.4.2      
 [76] knitr_1.43          gridExtra_2.3       distill_1.6        
 [79] stats4_4.3.0        xfun_0.39           devtools_2.4.5     
 [82] stringi_1.7.12      yaml_2.3.7          boot_1.3-28.1      
 [85] evaluate_0.21       codetools_0.2-19    tibble_3.2.1       
 [88] cli_3.6.1           xtable_1.8-4        systemfonts_1.0.4  
 [91] Rdpack_2.4          munsell_0.5.0       processx_3.8.1     
 [94] jquerylib_0.1.4     Rcpp_1.0.10         globals_0.16.2     
 [97] parallel_4.3.0      ellipsis_0.3.2      prettyunits_1.1.1  
[100] gap.datasets_0.0.6  profvis_0.3.8       urlchecker_1.0.1   
[103] lme4_1.1-33         listenv_0.9.0       viridisLite_0.4.2  
[106] scales_1.2.1        insight_0.19.6      purrr_1.0.1        
[109] crayon_1.5.2        rlang_1.1.1